package service.cms.controller;


import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import service.cms.entity.CrmBanner;
import service.cms.service.CrmBannerService;
import service.edu.result.R;

import java.util.List;

/**
 * <p>
 * 首页banner表 前端控制器
 * </p>
 *
 * @author diao
 * @since 2020-08-13
 */
@RestController
@CrossOrigin
@RequestMapping("/cms/frontBanner")
public class BannerFrontController {
    @Autowired
    private CrmBannerService crmBannerService;

    @ApiOperation("前台查询轮播图")
    @GetMapping("queryBanner")
    public R queryBanner(){
        List<CrmBanner> bannerList= crmBannerService.queryAllBanner();
       return R.Ok().data("bannerList", bannerList);
    }
}

